package com.glela.controller;

import java.util.Map;

import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.glela.order.service.impl.NotifyWxMsgServiceImpl;

/**
 * 通知-微信
 * @author zls
 *
 */
@Controller
@RequestMapping("/notify/wx")
public class NotifyWxController {
	@Autowired
	private NotifyWxMsgServiceImpl notifyWxMsgServiceImpl;

	@RequestMapping(value = "/sendMarketingSuccess")
	public @ResponseBody boolean sendMarketingSuccess(@RequestBody Map<String, ?> params) {
		notifyWxMsgServiceImpl.sendWxTemplateMsgMarketingSuccess(MapUtils.getLong(params, "objId"));
		return true;
	}

	@RequestMapping(value = "/sendCommissionArrival")
	public @ResponseBody boolean sendCommissionArrival(@RequestBody Map<String, ?> params) {
		notifyWxMsgServiceImpl.sendWxTemplateMsgCommissionArrival(MapUtils.getString(params, "userName"), MapUtils.getString(params, "commisionFee"));
		return true;
	}
}
